﻿<controls2:RibbonDialogWindow x:Class="Mnk.TBox.Plugins.TeamManager.Forms.TimeReportDialog"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:loc="clr-namespace:Mnk.TBox.Plugins.TeamManager.Code.Localization"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
                      xmlns:components="clr-namespace:Mnk.Library.WpfControls.Components;assembly=Mnk.Library.WPFControls"
                              xmlns:r="clr-namespace:Microsoft.Windows.Controls.Ribbon;assembly=RibbonControlsLibrary"
                            xmlns:controls2="clr-namespace:Mnk.TBox.Core.PluginsShared.Controls;assembly=Mnk.TBox.Core.PluginsShared"
                              xmlns:tools="clr-namespace:Mnk.Library.WpfControls.Tools;assembly=Mnk.Library.WPFControls"
                              xmlns:captioned2="clr-namespace:Mnk.Library.WpfControls.Components.Captioned;assembly=Mnk.Library.WPFControls"
                              mc:Ignorable="d"
             Width="640" Height="480"
             MinWidth="640" MinHeight="480"
             Title="{loc:Tr TimeReport}"
             d:DesignHeight="300" d:DesignWidth="300" ShowInTaskbar="True">
    <controls2:RibbonDialogWindow.Resources>
        <tools:BoolInverterConverter x:Key="BoolInverterConverter"/>
    </controls2:RibbonDialogWindow.Resources>
    <DockPanel Grid.Column="0">
        <r:Ribbon  DockPanel.Dock="Top" >
            <r:Ribbon.ApplicationMenu >
                <r:RibbonApplicationMenu Visibility="Collapsed"/>
            </r:Ribbon.ApplicationMenu>
            <r:RibbonTab Header="{loc:Tr Report}">
                <r:RibbonGroup>
                    <r:RibbonButton Label="{loc:Tr Generate}" Click="Generate_OnClick"  IsEnabled="False" Name="btnGenerate" LargeImageSource="/Mnk.TBox.Plugins.TeamManager;component/Resources/Start.ico"/>
                </r:RibbonGroup>
                <r:RibbonGroup Header="{loc:Tr Dates}">
                    <StackPanel Orientation="Horizontal">
                        <captioned2:CaptionedDatePicker Caption="{loc:Tr DateFrom}" Value="{Binding Report.DateFrom}" DockPanel.Dock="Bottom" Margin="5 0" ValueChanged="ValueChanged" Name="DateFrom" IsEnabled="{Binding ElementName=AutoGenerate,Path=IsChecked, Converter={StaticResource BoolInverterConverter}}" />
                        <captioned2:CaptionedDatePicker Caption="{loc:Tr DateTo}" Value="{Binding Report.DateTo}" DockPanel.Dock="Bottom" Margin="5 0" ValueChanged="ValueChanged" Name="DateTo" IsEnabled="{Binding ElementName=AutoGenerate,Path=IsChecked, Converter={StaticResource BoolInverterConverter}}" />
                    </StackPanel>
                    <r:RibbonCheckBox IsChecked="{Binding Report.AutoGenerate}" Name="AutoGenerate" Label="{loc:Tr AutoGenerate}" Checked="ValueChanged"/>
                </r:RibbonGroup>
                <r:RibbonGroup Header="{loc:Tr Operations}">
                    <DockPanel>
                        <components:PanelToICheckable Name="OpPanel" DockPanel.Dock="Bottom"/>
                        <components:CheckableListBox Name="Operations" Margin="5" OnCheckChanged="ValueChanged" ItemsSource="{Binding Operations}"/>
                    </DockPanel>
                </r:RibbonGroup >
            </r:RibbonTab>
            <r:RibbonTab Header="{loc:Tr Results}">
                <r:RibbonGroup >
                    <r:RibbonButton Label="{loc:Tr Refresh}" Click="RefreshResults" Name="btnRefresh" IsEnabled="False" LargeImageSource="/Mnk.TBox.Plugins.TeamManager;component/Resources/Refresh.ico"/>
                </r:RibbonGroup>
                <r:RibbonGroup Header="{loc:Tr Report}">
                    <r:RibbonCheckBox IsChecked="{Binding Report.AddNotPresentDays}" Label="{loc:Tr AddNotPresentDays}"/>
                    <captioned2:CaptionedNumericUpDown Caption="{loc:Tr WorkingHoursPerDay}" Value="{Binding Report.WorkingHoursPerDay}" Maximum="24" Minimum="1"/>
                </r:RibbonGroup>
                <r:RibbonGroup Header="{loc:Tr Advanced}">
                    <StackPanel Orientation="Horizontal">
                        <captioned2:CaptionedComboBox HorizontalAlignment="Center" Value="{Binding Report.Style}" Name="StylesList" Width="100" Caption="{loc:Tr Style}" Margin="2"/>
                        <captioned2:CaptionedComboBox HorizontalAlignment="Center" Value="{Binding Report.DayStatusStrategy}" Name="Validators" Width="100" Caption="{loc:Tr Validator}" Margin="2"/>
                    </StackPanel>
                    <r:RibbonCheckBox Label="{loc:Tr HidePersonsWithoutErrors}" IsChecked="{Binding Report.FilterResultsByErrors}" Name="FilterByTime"/>
                </r:RibbonGroup>
                <r:RibbonGroup Header="{loc:Tr Export}">
                    <r:RibbonButton Label="{loc:Tr CopyToClipboard}" Click="CopyClick"  x:Name="btnCopy" IsEnabled="False"/>
                    <r:RibbonButton Label="{loc:Tr ToEmail}" Click="ToEmailClick"  x:Name="btnToEmail" IsEnabled="False"/>
                </r:RibbonGroup>
            </r:RibbonTab>
        </r:Ribbon>
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition />
                <ColumnDefinition Width="200"/>
            </Grid.ColumnDefinitions>
            <WebBrowser Name="HtmlReport" />
            <DockPanel DockPanel.Dock="Right" Grid.Column="1" Margin="5 0 0 13">
                <Label Content="{loc:Tr Persons}" DockPanel.Dock="Top" Margin="5 0" Padding="0"/>
                <components:PanelToICheckable Name="Panel" DockPanel.Dock="Bottom"/>
                <components:CheckableListBox Name="Persons" Margin="5 0 5 5" OnCheckChanged="ValueChanged" ItemsSource="{Binding Persons}"/>
            </DockPanel>
        </Grid>
    </DockPanel>
</controls2:RibbonDialogWindow>
